#ifndef _InfinatePlane_H_
#define _InfinatePlane_H_

#pragma once
#include "Primitive.h"

class InfinatePlane : public Primitive {
private:
	Vector3 position, normal;
	Double d;
	bool doubleSide;

public:
	InfinatePlane(Normal3 &normal, Double d, bool doubleSide = true) 
		: normal(normal), d(d), position(-normal * d), doubleSide(doubleSide){}
	~InfinatePlane() {}

	bool intersect(const Ray &ray, IntersectResult &result) const;
	bool intersectP(const Ray &ray) const;

	inline static string getName() {
		return string("InfinatePlane");
	}
	string str() const;
};

#endif // _InfinatePlane_H_
